package cn.amoqi.springboot.validator.controller;

import cn.amoqi.springboot.validator.model.Student;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
public class ValidatorController {
    @RequestMapping("/create")
    public String create(@Validated @RequestBody Student student){
        return "参数验证成功";
    }
}
